package com.mmall.dao;

import com.mmall.pojo.Product;
import com.mmall.vo.ProductListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);


    List<Product> selectByCategoryIdAndKeywordSelective(@Param("categoryIdList") List<Integer> categoryIdList,
                                                        @Param("productName") String productName);

    List<Product> selectAll();

    List<Product> selectByProductIdOrName(@Param("productName") String productName, @Param("productId") Integer productId);

    int setSaleStatus(@Param("productId") Integer productId, @Param("status") Integer status);

    int selectProductStock(int proudctId);
}